/*
* Template Customizer Style
**/

$customizer-width: 400px;
$customizer-width-sm: 300px;
$customizer-hide-width: 1200px;
$customizer-spacer: 20px;
$customizer-font-size: inherit;

$open-btn-size: 42px;
$open-btn-spacer: 0;
$open-btn-font-size: 18px;
$open-btn-top: 180px;
$open-btn-top-md: 145px;

$open-btn-bg: var(--bs-primary);
$open-btn-bg-dark: var(--bs-primary);
$open-btn-color: #fff;
$open-btn-border-radius: 15%;
$open-customizer-primary-color: var(--bs-primary);

#template-customizer {
  font-family: 'Public Sans', BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif,
    'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol' !important;
  font-size: $customizer-font-size !important;
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  z-index: 99999999;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  width: $customizer-width;
  background: #fff;
  -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2);
  box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2);
  -webkit-transition: all 0.2s ease-in;
  -o-transition: all 0.2s ease-in;
  transition: all 0.2s ease-in;
  -webkit-transform: translateX($customizer-width + $customizer-spacer);
  -ms-transform: translateX($customizer-width + $customizer-spacer);
  transform: translateX($customizer-width + $customizer-spacer);

  h5 {
    position: relative;
    font-size: 11px;
  }

  > h5 {
    flex: 0 0 auto;
  }

  .disabled {
    color: #d1d2d3 !important;
  }
  .form-label {
    font-size: 0.9375rem;
  }
  .form-check-label {
    font-size: 0.8125rem;
  }

  .template-customizer-t-panel_header {
    font-size: 1.125rem;
  }

  &.template-customizer-open {
    -webkit-transition-delay: 0.1s;
    -o-transition-delay: 0.1s;
    transition-delay: 0.1s;
    -webkit-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;

    .custom-option.checked {
      color: $open-customizer-primary-color;
      border-width: 2px;
      .custom-option-content {
        border: none;
      }
    }
    .custom-option {
      .custom-option-content {
        border: 1px solid transparent;
      }
    }
  }

  .template-customizer-header {
    a:hover {
      color: inherit !important;
    }
  }
  // Customizer button

  .template-customizer-open-btn {
    position: absolute;
    top: $open-btn-top;

    @media (max-width: 991.98px) {
      top: $open-btn-top-md;
    }
    left: 0;
    z-index: -1;
    display: block;
    width: $open-btn-size;
    height: $open-btn-size;
    border-top-left-radius: $open-btn-border-radius;
    border-bottom-left-radius: $open-btn-border-radius;
    background: $open-btn-bg;
    color: $open-btn-color !important;
    text-align: center;
    font-size: $open-btn-font-size !important;
    line-height: $open-btn-size;
    opacity: 1;
    -webkit-transition: all 0.1s linear 0.2s;
    -o-transition: all 0.1s linear 0.2s;
    transition: all 0.1s linear 0.2s;
    -webkit-transform: translateX(-($open-btn-size + $customizer-spacer + $open-btn-spacer));
    -ms-transform: translateX(-($open-btn-size + $customizer-spacer + $open-btn-spacer));
    transform: translateX(-($open-btn-size + $customizer-spacer + $open-btn-spacer));

    .dark-style & {
      background: $open-btn-bg-dark;
    }
    &::before {
      content: '';
      width: 22px;
      height: 22px;
      display: block;
      background-size: 100% 100%;
      position: absolute;
      background-image: url('');
      margin: 10px;
    }

    // Customizer Hidden
    .customizer-hide & {
      display: none;
    }

    [dir='rtl'] & {
      border-radius: 0;
      border-top-right-radius: $open-btn-border-radius;
      border-bottom-right-radius: $open-btn-border-radius;

      &::before {
        margin-left: -2px;
      }
    }
  }

  &.template-customizer-open .template-customizer-open-btn {
    opacity: 0;
    -webkit-transition-delay: 0s;
    -o-transition-delay: 0s;
    transition-delay: 0s;
    -webkit-transform: none !important;
    -ms-transform: none !important;
    transform: none !important;
  }

  // Customizer inner
  .template-customizer-inner {
    position: relative;
    overflow: auto;
    -webkit-box-flex: 0;
    -ms-flex: 0 1 auto;
    flex: 0 1 auto;
    opacity: 1;
    -webkit-transition: opacity 0.2s;
    -o-transition: opacity 0.2s;
    transition: opacity 0.2s;

    > div:first-child {
      > hr:first-of-type {
        display: none !important;
      }
      > h5:first-of-type {
        padding-top: 0 !important;
      }
    }
  }

  // Theme
  .template-customizer-themes-inner {
    position: relative;
    opacity: 1;
    -webkit-transition: opacity 0.2s;
    -o-transition: opacity 0.2s;
    transition: opacity 0.2s;
  }

  .template-customizer-theme-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    align-items: center;
    -ms-flex-align: center;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 100%;
    flex: 1 1 100%;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 0 24px;
    width: 100%;
    cursor: pointer;

    input {
      position: absolute;
      z-index: -1; // Put the input behind the label so it doesn't overlay text
      opacity: 0;
    }

    input ~ span {
      opacity: 0.25;
      -webkit-transition: all 0.2s;
      -o-transition: all 0.2s;
      transition: all 0.2s;
    }

    .template-customizer-theme-checkmark {
      display: inline-block;
      width: 6px;
      height: 12px;
      border-right: 1px solid;
      border-bottom: 1px solid;
      opacity: 0;
      -webkit-transition: all 0.2s;
      -o-transition: all 0.2s;
      transition: all 0.2s;
      -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
      transform: rotate(45deg);

      [dir='rtl'] & {
        border-right: none;
        border-left: 1px solid;
        -webkit-transform: rotate(-45deg);
        -ms-transform: rotate(-45deg);
        transform: rotate(-45deg);
      }
    }

    input:checked:not([disabled]) ~ span,
    &:hover input:not([disabled]) ~ span {
      opacity: 1;
    }

    input:checked:not([disabled]) ~ span .template-customizer-theme-checkmark {
      opacity: 1;
    }
  }

  .template-customizer-theme-colors {
    span {
      display: block;
      margin: 0 1px;
      width: 10px;
      height: 10px;
      border-radius: 50%;
      -webkit-box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) inset;
      box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) inset;
    }
  }

  &.template-customizer-loading .template-customizer-inner,
  &.template-customizer-loading-theme .template-customizer-themes-inner {
    opacity: 0.2;

    &::after {
      content: '';
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 999;
      display: block;
    }
  }
}
@media (max-width: $customizer-hide-width) {
  #template-customizer {
    display: none;
    visibility: hidden !important;
  }
}
@media (max-width: 575.98px) {
  #template-customizer {
    width: $customizer-width-sm;
    -webkit-transform: translateX($customizer-width-sm + $customizer-spacer);
    -ms-transform: translateX($customizer-width-sm + $customizer-spacer);
    transform: translateX($customizer-width-sm + $customizer-spacer);
  }
}

.layout-menu-100vh #template-customizer {
  height: 100vh;
}

// RTL
//

[dir='rtl'] {
  #template-customizer {
    right: auto;
    left: 0;
    -webkit-transform: translateX(-($customizer-width + $customizer-spacer));
    -ms-transform: translateX(-($customizer-width + $customizer-spacer));
    transform: translateX(-($customizer-width + $customizer-spacer));
  }

  #template-customizer .template-customizer-open-btn {
    right: 0;
    left: auto;
    -webkit-transform: translateX($open-btn-size + $customizer-spacer + $open-btn-spacer);
    -ms-transform: translateX($open-btn-size + $customizer-spacer + $open-btn-spacer);
    transform: translateX($open-btn-size + $customizer-spacer + $open-btn-spacer);
  }

  #template-customizer .template-customizer-close-btn {
    right: auto;
    left: 0;
  }
}

#template-customizer .template-customizer-layouts-options[disabled] {
  opacity: 0.5;
  pointer-events: none;
}

// ! FIX: mode switch position in RTL
[dir='rtl'] {
  .template-customizer-t-style_switch_light {
    padding-right: 0 !important;
  }
}
